﻿/*
* Copyright (c) 2010-2012 Tesla Engine Group
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/


using System;
using Tesla.Graphics;
using Tesla.Math;

namespace Tesla.Core {
    /// <summary>
    /// Interface that defines the underlying implementation of a Window.
    /// </summary>
    public interface IWindowImplementation : IDisposable {

        /// <summary>
        /// Event for when the window is resized or changed.
        /// </summary>
        event EventHandler ClientSizeChanged;

        /// <summary>
        /// Event for when the window's orientation is changed.
        /// </summary>
        event EventHandler OrientationChanged;

        /// <summary>
        /// Event for when the window is the primary window and has been activated.
        /// </summary>
        event EventHandler Activated;

        /// <summary>
        /// Event for when the window is the primary window and has been deactivated.
        /// </summary>
        event EventHandler Deacativated;

        /// <summary>
        /// Event for when the window is the primary window and has been resumed.
        /// </summary>
        event EventHandler Resume;

        /// <summary>
        /// Event for when the window is the primary window and has been suspended.
        /// </summary>
        event EventHandler Suspend;
        
        /// <summary>
        /// Gets or sets if the user should be able to change the size of the window (e.g. drag the borders with the mouse).
        /// </summary>
        bool AllowUserResizing {
            get;
            set;
        }

        /// <summary>
        /// Gets if the window is primary. A primary window is defined to be a window that can be run by a window host, e.g. a Form.
        /// </summary>
        bool IsPrimaryWindow {
            get;
        }

        /// <summary>
        /// Gets the client bounds of the window.
        /// </summary>
        Rectangle ClientBounds {
            get;
        }

        /// <summary>
        /// Gets the handle to the underlying window.
        /// </summary>
        IntPtr Handle {
            get;
        }

        /// <summary>
        /// Gets if the window is minimized.
        /// </summary>
        bool IsMinimized {
            get;
        }

        /// <summary>
        /// Gets or sets the window's title.
        /// </summary>
        String Title {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets if the mouse should be visible.
        /// </summary>
        bool IsMouseVisible {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets if the window should be full screen. This toggles the effect.
        /// </summary>
        bool IsFullScreen {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the swap chain owned by the window.
        /// </summary>
        SwapChain SwapChain {
            get;
        }

        /// <summary>
        /// Gets if the window has been disposed.
        /// </summary>
        bool IsDisposed {
            get;
        }

        /// <summary>
        /// Resizes the client area of the window using the specified parameters.
        /// </summary>
        /// <param name="width">Width of the client area</param>
        /// <param name="height">Height of the client area</param>
        void Resize(int width, int height);
    }
}
